package viewControllers.robot;

import globals.GlobalObjects;

import javax.media.opengl.GL;

import physics.GameObject;
import viewControllers.ViewController;

public class BunnyViewController extends ViewController{

	public BunnyViewController(GameObject object) {
		super(object);

		
		jp.getCenter().setValues(0, 0.15, 0);
		jp.setScale(0.05);

		Torso body = new Torso(GlobalObjects.getGraphic("bunny_torso"));
		body.rotate(0, 0, 0);
		body.getCenter().setValues(0, 0, 0);
		body.setScale(1.5);
		this.addPart(body);
		{
		Leg legR = new Leg(GlobalObjects.getGraphic("bunny_leg"));
		legR.getCenter().setValues(-1.5, -1, 0);
		legR.direction = -1;
		this.addPart(legR);
		
		Leg legL = new Leg(GlobalObjects.getGraphic("bunny_leg"));
		legL.getCenter().setValues(1.5, -1, 0);
		this.addPart(legL);
		}
		{
		Leg earR = new Leg(GlobalObjects.getGraphic("bunny_ear"));
		earR.getCenter().setValues(-0.75, 0.5, 0);
		this.addPart(earR);
		
		Leg earL = new Leg(GlobalObjects.getGraphic("bunny_ear"));
		earL.getCenter().setValues(0.75, 0.5, 0);
		earL.direction = -1;
		this.addPart(earL);
		}
		
		object.setGraphicalObject(this);
		this.setPosition(object.getPosition());
		

		RobotWalkAnimator rwa = new RobotWalkAnimator(parts);
		setAnimator(rwa);
		
	}
	
	
	

	@Override
	public void play() {
		if (object.getMovementControler().getDistance() > 0.0001)
			super.play();
	}
	
	




	@Override
	public void render(GL gl) {
		// TODO Auto-generated method stub
		super.render(gl);
	}


}
